import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import { getInfoCity2 } from '@/utils/auth'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    showDialog: false,
    city: getInfoCity2() || '乐山'
  },
  getters: {
    token (state) {
      return state.user.userInfo.token
    },
    showDialog (state) {
      return state.showDialog
    },
    city (state) {
      return state.city
    }
  },
  mutations: {
    setShowDialog (state, obj) {
      state.showDialog = obj
    },
    setcity (state, obj) {
      state.city = obj
    }
  },
  actions: {
  },
  modules: {
    user
  }
})
